package com.outstanding.ifml.warpper;

import java.util.ArrayList;
import java.util.List;

public class ArrayValue extends Value{
	
	
	public ArrayValue() {
		super(ValueType.array);
	}
	
	
	private List<String> values = new ArrayList<String>();
	
	public List<String> getValues() {
		return values;
	}

	public String getLiteral() {
		
		StringBuffer sb = new StringBuffer("[");
		for(String str:values) {
			sb.append("\"").append(str).append("\"").append(",");
		}
		sb.deleteCharAt(sb.length()-1);
		sb.append("]");
		return sb.toString();
	}
	
	public void setLiteral(String str) {
		values.add(str);
	}
	
	
	public static void main(String[] args) {
		ArrayValue av = new ArrayValue();
		av.setLiteral("a");
		av.setLiteral("a");
		av.setLiteral("b");
		av.setLiteral("a");
		System.out.println(av.getLiteral());
	}
}
